Repository navigation
Conversation
* Check that the removed listener is not called. * Opportunistic `==` -> `===` change.
| // Test on condition where a watcher for SIGNAL | ||
| // has been previously registered, and `process.listeners(SIGNAL).length === 1` | ||
| process.on('SIGHUP', function() {}); | ||
| process.on('SIGHUP', function() { common.fail('should not run'); }); |
Member
Author
There was a problem hiding this comment.
If the function is called, the test has failed. It would be wrapped in a 'common.mustNotCall()' if we had one.
Member
There was a problem hiding this comment.
I would simply make this
process.on('SIGHUP', common.fail)And just do without the should not run text.
Member
Author
There was a problem hiding this comment.
@jasnell Done that way, the AssertionError looks like this:
AssertionError: null undefined null
at process.exports.fail (/Users/trott/io.js/test/common.js:438:10)
at emitNone (events.js:91:20)
at process.emit (events.js:185:7)
at Signal.wrap.onsignal (internal/process.js:199:44)
There are two things I don't like about that:
- The stack trace does not show where the actual problem is. It does not mention the test file at all.
null undefined null: What?!
In contrast, done the way it is in this PR, it looks like this:
AssertionError: should not run
at Object.exports.fail (/Users/trott/io.js/test/common.js:438:10)
at process.<anonymous> (/Users/trott/io.js/test/parallel/test-signal-handler.js:32:42)
at emitNone (events.js:91:20)
at process.emit (events.js:185:7)
at Signal.wrap.onsignal (internal/process.js:199:44)
The stack trace includes the name of the test file and the line that resulted in the failure.
Member
There was a problem hiding this comment.
null undefined null is going to be my new catchphrase... sigh.. looks like we should tweak the output for common.fail
Contributor
|
LGTM |
Member
Author
Trott
added a commit
to Trott/io.js
that referenced
this pull request
Aug 26, 2016
* Check that the removed listener is not called. * Opportunistic `==` -> `===` change. PR-URL: nodejs#8248 Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Member
Author
|
Landed in a6d53c6 |
Closed
Fishrock123
pushed a commit
to Fishrock123/node
that referenced
this pull request
Sep 8, 2016
* Check that the removed listener is not called. * Opportunistic `==` -> `===` change. PR-URL: nodejs#8248 Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Fishrock123
pushed a commit
that referenced
this pull request
Sep 9, 2016
* Check that the removed listener is not called. * Opportunistic `==` -> `===` change. PR-URL: #8248 Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
MylesBorins
pushed a commit
that referenced
this pull request
Sep 30, 2016
* Check that the removed listener is not called. * Opportunistic `==` -> `===` change. PR-URL: #8248 Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
MylesBorins
pushed a commit
that referenced
this pull request
Oct 10, 2016
* Check that the removed listener is not called. * Opportunistic `==` -> `===` change. PR-URL: #8248 Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
rvagg
pushed a commit
that referenced
this pull request
Oct 18, 2016
* Check that the removed listener is not called. * Opportunistic `==` -> `===` change. PR-URL: #8248 Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
MylesBorins
pushed a commit
that referenced
this pull request
Oct 26, 2016
* Check that the removed listener is not called. * Opportunistic `==` -> `===` change. PR-URL: #8248 Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Checklist
make -j4 test(UNIX), orvcbuild test nosign(Windows) passesAffected core subsystem(s)
test process
Description of change
==->===change.